import React from 'react';


import './index.less';

import PersonRefer from '../../../../../../public/components/PersonRefer';

import { base } from 'nc-lightapp-front';

import {
    getBusinessInfo
} from 'nc-lightapp-front';

let businessInfo = getBusinessInfo() || {};

const {
    NCButton
} = base;

export default (props) => {

    return (
        <div className="batch-add-selectman">
            <div className="batch-add-selectman-action-wrapper">
                <div className="batch-add-selectman-condition-wrapper">
                    <div
                        style={{
                            float: 'left'
                        }}
                    >
                        <PersonRefer
                            refcode={props.batchAddSelectManRefer ? props.batchAddSelectManRefer.refcode : 'hrhi/refer/hiref/PsnjobAOSTreeGridRef/index'}
                            clickContainer={
                                <NCButton>
                                    {props.language['gx6008-000060']/** 参照选择 */}
                                </NCButton>
                            }
                            isMultiSelectedEnabled={true}
                            queryCondition={() => {
                                return {
                                    pk_org: props.pk_org,
                                    pk_group: businessInfo.groupId,
                                    isIncludeKeyPsnGrp: true,
                                    funcPK: '@@@@Z710000000006M0I',
                                    GridRefActionExt: "nccloud.web.hryf.partapply.sqlbuilder.PartBatchSelPsnRefSqlBuilder"
                                }
                            }}
                            onChange={props.changePersonRefer}
                            isCacheable={false}
                        />
                    </div>
                    <div
                        style={{
                            float: 'left'
                        }}
                    >
                        <NCButton
                            onClick={props.openBatchAddSearchModal}
                        >
                            {props.language['gx6008-000061']/** 条件选择 */}
                        </NCButton>
                    </div>
                </div>

            </div>
            <div>
                {props.editTable.createEditTable('list_batch', {
                    showCheck: true,
                    onSelectedAll: props.selectedAll,
                    cancelCustomRightMenu: true
                })}
            </div>
        </div>
    );

}